function changehotelvalue(selectedvalue) { boolupdatebox=false; if (window.XMLHttpRequest) { var xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } var url="/custom/steigenberger/handler/hotelsajaxtemplate.asp?containerpath=aaaaaaaaaaadvyh%5Caaaaaaaaaaadvzf%5Caaaaaaaaaaadyee%5Caaaaaaaaaaadstk%5Caaaaaaaaaaadtyy%5Caaaaaaaaaaadubo%5Caaaaaaaaaaadujy%5Caaaaaaaaaaafnzo%5C&brandid=aaaaaaaaaaadyhn&segmentid=aaaaaaaaaaafrve&languageid="; if (selectedvalue!='' && selectedvalue!='undefined') { var url=url + "&destinationid=" + encodeURIComponent(selectedvalue); } //document.location.href=url; xmlHttp.open("GET", url, true); //xmlHttp.overrideMimeType('text/xml'); xmlHttp.onreadystatechange = getresult; xmlHttp.send (null); function getresult() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { if (document.implementation.createDocument) { //alert(xmlHttp.responseXML); // var parser = new DOMParser() doc = xmlHttp.responseXML; // MSIE } else if (window.ActiveXObject) { doc = new ActiveXObject("Microsoft.XMLDOM") doc.async="false" doc.loadXML(xmlHttp.responseText) } var newdropdownitems=doc.getElementsByTagName('hotels')[0].getElementsByTagName("hotel"); document.getElementById("hotels").length=0; var currentbrand=""; for (var j = 0; j < newdropdownitems.length; j++) { if(newdropdownitems[j].getAttribute('brand')!=null) { if (currentbrand=="" || currentbrand!=newdropdownitems[j].getAttribute('brand')) { var objOptionExtra = new Option(" " + newdropdownitems[j].getAttribute('brand'),"*"); document.getElementById("hotels").options[document.getElementById("hotels").length] = objOptionExtra; document.getElementById("hotels").options[document.getElementById("hotels").length-1].setAttribute("style","margin-left:5px;"); currentbrand=newdropdownitems[j].getAttribute('brand'); } } var objOption; if(currentbrand!="") { objOption = new Option(" " + unescape(newdropdownitems[j].getAttribute('title')),newdropdownitems[j].getAttribute('id')); document.getElementById("hotels").options[document.getElementById("hotels").length] = objOption; document.getElementById("hotels").options[document.getElementById("hotels").length-1].setAttribute("style","margin-left:10px;"); } else { objOption = new Option(unescape(newdropdownitems[j].getAttribute('title')),newdropdownitems[j].getAttribute('id')); document.getElementById("hotels").options[document.getElementById("hotels").length] = objOption; } } currentbrand=""; } } } }